package com.zmn.oms.business.interfaces.order;

import com.zmn.oms.common.dio.redistribute.DoingDuplicateOrderDIO;
import com.zmn.oms.common.dto.ResultDTO;
import com.zmn.oms.model.dto.order.zmn.ZsNormalUpdateOrderDTO;
import com.zmn.oms.model.dto.work.modify.CancelDuplicateOrderDTO;
import com.zmn.oms.model.dto.work.modify.DuplicateOrderDTO;
import com.zmn.oms.model.dto.work.modify.SuspectedDuplicateOrderDTO;
import com.zmn.oms.model.dto.work.modify.VerifyTelephoneOrProductDTO;
import com.zmn.oms.model.entity.work.OrderWork;

/**
 * @author liuying
 * @date:2021-01-25 11:37:47
 * description: 重复单
 */
public interface DuplicateOrderBService {


    /**
     * 重复单检查（用于新增订单检查）
     *
     * @param duplicateDTO
     * @return
     */
    Long findDuplicateOrderId(DuplicateOrderDTO duplicateDTO);

    /**
     * 取消订单时重复单检查(手动取消检查)
     *
     * @param orderId
     * @param workId
     * @param duplicateWorkId
     * @return
     */
    ResultDTO verifyCancelOrderDuplicate(Long orderId, Long workId, Long duplicateWorkId);

    /**
     * 取消订单时获取重复单ID，如果没有，返回空
     *
     * @param orderWork
     * @return
     */
    Long findDuplicateOrderId(OrderWork orderWork);

    /**
     *  获取在途重复订单ID
     * @param doingDuplicateOrderDIO
     * @return
     */
    Long findDoingDuplicateOrderId(DoingDuplicateOrderDIO doingDuplicateOrderDIO);


    /**
     * 取消订单时获取重复单ID，如果没有，返回空
     *
     * @param duplicateDTO
     * @return
     */
    Long findCancelDuplicateOrder(CancelDuplicateOrderDTO duplicateDTO);


    /**
     * 派单超时获取重复单ID，如果没有，返回空
     *
     * @param orderWork
     * @return
     */
    Long findDistributeTimeoutDuplicateOrderId(OrderWork orderWork);

    /**
     * 疑似重复跟单处理
     *
     * @param duplicateOrderDTO
     */
    void handleSuspectedDuplicateTrack(DuplicateOrderDTO duplicateOrderDTO);

    /**
     * 重复单异步处理
     *
     * @param suspectedDuplicateOrderDTO
     */
    void noticeSuspectedDuplicateOrderToMq(SuspectedDuplicateOrderDTO suspectedDuplicateOrderDTO);

    /**
     * 验证电话或者产品是否修改过
     * @param verifyTelephoneOrProductDTO
     * @return true 修改过 false 没有修改
     */
    boolean verifyTelephoneOrProduct(VerifyTelephoneOrProductDTO verifyTelephoneOrProductDTO);
}
